import http from "../request";
const apibase = "/api/BasicType"
import qs from 'qs'

//查询基础类别
var GetBasicTypeList = function(data) {
	return new Promise((resolve, reject) => {
		http.post(apibase + `/GetBasicTypeList`,data)
			.then(res => {
				resolve(res)
			})
			.catch(error => {
				reject(error);
			})
	});
}
//添加基础类别
var insBasicType = function(data) {
	return new Promise((resolve, reject) => {
		http.post(apibase + `/InsBasicType`, data)
			.then(res => {
				resolve(res)
			})
			.catch(error => {
				reject(error);
			})
	});
}

//修改基础类别
var updBasicType = function(data) {
	return new Promise((resolve, reject) => {
		http.post(apibase + `/UpdBasicType`, data)
			.then(res => {
				resolve(res)
			})
			.catch(error => {
				reject(error);
			})
	});
}

//删除基本类别
var DelBasicType = function(data) {
	return new Promise((resolve, reject) => {
		http.post(apibase + `/DelBasicType`, data)
			.then(res => {
				resolve(res)
			})
			.catch(error => {
				reject(error);
			})
	});
}

//查询基础项
var GetBasicList = function(data) {
	const datas = qs.stringify(data)
	return new Promise((resolve, reject) => {
		http.post(apibase + `/GetBasicList`,data)
			.then(res => {
				resolve(res)
			})
			.catch(error => {
				reject(error);
			})
	});
}

//新增基础项
var insBasic = function(data) {
	return new Promise((resolve, reject) => {
		http.post(apibase + `/InsBasic`, data)
			.then(res => {
				resolve(res)
			})
			.catch(error => {
				reject(error);
			})
	});
}
//修改基础项
var updBasic = function(data) {
	return new Promise((resolve, reject) => {
		http.post(apibase + `/UpdBasic`, data)
			.then(res => {
				resolve(res)
			})
			.catch(error => {
				reject(error);
			})
	});
}
//删除基础项
var DelBasic = function(data) {
	return new Promise((resolve, reject) => {
		http.post(apibase + `/DelBasic`, data)
			.then(res => {
				resolve(res)
			})
			.catch(error => {
				reject(error);
			})
	});
}
//查询附加属性
var GetExtAttributeList = function(data) {
	return new Promise((resolve, reject) => {
		http.post(apibase + `/GetExtAttributeList?${qs.stringify(data)}`, )
			.then(res => {
				resolve(res)
			})
			.catch(error => {
				reject(error);
			})
	});
}
//新增附加属性
var insExtAttribute = function(data) {
	return new Promise((resolve, reject) => {
		http.post(apibase + `/InsExtAttribute`, data)
			.then(res => {
				resolve(res)
			})
			.catch(error => {
				reject(error);
			})
	});
}
//修改基础项
var updExtAttribute = function(data) {
	return new Promise((resolve, reject) => {
		http.post(apibase + `/UpdExtAttribute`, data)
			.then(res => {
				resolve(res)
			})
			.catch(error => {
				reject(error);
			})
	});
}

//删除基础项
var DelExtAttribute = function(data) {
	return new Promise((resolve, reject) => {
		http.post(apibase + `/DelExtAttribute`, data)
			.then(res => {
				resolve(res)
			})
			.catch(error => {
				reject(error);
			})
	});
}




export {
	GetBasicTypeList,
	insBasicType,
	updBasicType,
	DelBasicType,
	GetBasicList,
	insBasic,
	updBasic,
	DelBasic,
	GetExtAttributeList,
	insExtAttribute,
	updExtAttribute,
	DelExtAttribute
}
